<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<div class="bbyy">
  <% include head.ejs %>
<div class="container">
  <div class="row">
    <div class="col-sm-6 col-md-3">
      <div>
        <h3>分类</h3>
        <hr>
        <p><a href="">球衣</a></p>
        <p><a href="">球衣</a></p>
        <p><a href="">球衣</a></p>
        <p><a href="">球衣</a></p>
      </div>
    </div>
    <div class="col-sm-6 col-md-9">
      <div class="row" id="list">
      </div>
    </div>
  </div>
</div>
  <% include foot.ejs %>
  <template id="con_temp">
    <a href="/users/xiangqin?id={id}">
    <div class="col-sm-6 col-md-4">
      <div class="thumbnail">
        <img src="/uplods/{img}" style="height: 250px;width: 250px">
        <div class="caption">
          <p>{name} </p>
          <h3>￥{money}</h3>
        </div>
      </div>
    </div>
    </a>

    <!--<div class="col-sm-3">-->
      <!--<a href="/users/detail?id={id}">-->
        <!--<figure>-->
          <!--<img src="/uploads/{imgsrc}" alt="">-->
          <!--<p>{name}</p>-->
          <!--<span>{price}</span>-->
        <!--</figure>-->
      <!--</a>-->
    <!--</div>-->
  </template>
</div>
<script>
  $(function () {
    function show() {
      $.getJSON('/users/list', function (obj) {
        let temp = $('#con_temp').html();
        let html = '';
        console.log(obj)
        obj.qq.forEach(function (el) {
          html += temp.replace('{name}', el.name).replace('{money}', el.money).replace('{img}', el.img).replace('{id}', el.id)
        })
        $('#list').html(html);
      })
    }
    show();

  })
</script>
</html>
